package com.ruoyi.docdraw.service.impl;

import java.util.List;

import com.ruoyi.docdraw.domain.SysDocMaster;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.docdraw.mapper.SysDocdrawSupplierMapper;
import com.ruoyi.docdraw.domain.SysDocdrawSupplier;
import com.ruoyi.docdraw.service.ISysDocdrawSupplierService;

/**
 * 图纸供应商关联Service业务层处理
 * 
 * @author lvtian
 * @date 2025-04-18
 */
@Service
public class SysDocdrawSupplierServiceImpl implements ISysDocdrawSupplierService 
{
    @Autowired
    private SysDocdrawSupplierMapper sysDocdrawSupplierMapper;

    /**
     * 查询图纸供应商关联
     * 
     * @param docId 图纸供应商关联主键
     * @return 图纸供应商关联
     */
    @Override
    public SysDocdrawSupplier selectSysDocdrawSupplierByDocId(Long docId)
    {
        return sysDocdrawSupplierMapper.selectSysDocdrawSupplierByDocId(docId);
    }

    /**
     * 查询图纸供应商关联列表
     * 
     * @param sysDocdrawSupplier 图纸供应商关联
     * @return 图纸供应商关联
     */
    @Override
    public List<SysDocdrawSupplier> selectSysDocdrawSupplierList(SysDocdrawSupplier sysDocdrawSupplier)
    {
        return sysDocdrawSupplierMapper.selectSysDocdrawSupplierList(sysDocdrawSupplier);
    }

    /**
     * 新增图纸供应商关联
     * 
     * @param sysDocdrawSupplier 图纸供应商关联
     * @return 结果
     */
    @Override
    public int insertSysDocdrawSupplier(SysDocdrawSupplier sysDocdrawSupplier)
    {
        return sysDocdrawSupplierMapper.insertSysDocdrawSupplier(sysDocdrawSupplier);
    }

    /**
     * 修改图纸供应商关联
     * 
     * @param sysDocdrawSupplier 图纸供应商关联
     * @return 结果
     */
    @Override
    public int updateSysDocdrawSupplier(SysDocdrawSupplier sysDocdrawSupplier)
    {
        return sysDocdrawSupplierMapper.updateSysDocdrawSupplier(sysDocdrawSupplier);
    }

    /**
     * 批量删除图纸供应商关联
     * 
     * @param docIds 需要删除的图纸供应商关联主键
     * @return 结果
     */
    @Override
    public int deleteSysDocdrawSupplierByDocIds(Long[] docIds)
    {
        return sysDocdrawSupplierMapper.deleteSysDocdrawSupplierByDocIds(docIds);
    }

    /**
     * 删除图纸供应商关联信息
     * 
     * @param docId 图纸供应商关联主键
     * @return 结果
     */
    @Override
    public int deleteSysDocdrawSupplierByDocId(Long docId)
    {
        return sysDocdrawSupplierMapper.deleteSysDocdrawSupplierByDocId(docId);
    }

    @Override
    public List<SysDocMaster> selectJoinedList(SysDocdrawSupplier docdrawSupplier, String docName, String docNumber) {
        SysDocMaster sysDocMaster = new SysDocMaster();
        sysDocMaster.setDocName(docName);
        sysDocMaster.setDocNumber(docNumber);
        sysDocMaster.setSysDocdrawSupplier(docdrawSupplier);
        return sysDocdrawSupplierMapper.selectJoinedList(sysDocMaster);
    }
}
